package cn.wolfcode.car.business.mapper;

import cn.wolfcode.car.business.domain.Statement;
import cn.wolfcode.car.business.query.StatementQueryObject;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 声明映射器
 *
 * @author RNIZ
 * @date 2021/11/14
 */
public interface StatementMapper {
    /**
     * 按主键删除
     *
     * @param id id
     * @return int
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 插入
     *
     * @param record 记录
     * @return int
     */
    int insert(Statement record);

    /**
     * 选择通过主键
     *
     * @param id id
     * @return {@link Statement}
     */
    Statement selectByPrimaryKey(Long id);

    /**
     * 选择所有
     *
     * @return {@link List}<{@link Statement}>
     */
    List<Statement> selectAll();

    /**
     * 更新的主键
     *
     * @param record 记录
     * @return int
     */
    int updateByPrimaryKey(Statement record);

    /**
     * 选择列表
     *
     * @param qo 问:
     * @return {@link List}<{@link Statement}>
     */
    List<Statement> selectForList(StatementQueryObject qo);

    void updateBy(@Param("totalAmount") BigDecimal totalAmount, @Param("totalCount") BigDecimal totalCount, @Param("itemPrice") BigDecimal itemPrice, @Param("statementId") Long statementId);


    void changeBystatus(@Param("statementId") Long statementId, @Param("statusPaid") Integer statusPaid, @Param("userId") Long userId);

    Statement selectByAppipontId(Long appliontId);
}